package com.zdsoft.blp.zongbuju.shouye.linliquan.activity;

import android.content.Intent;
import android.text.Html;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.squareup.picasso.Picasso;
import com.zdsoft.blp.R;
import com.zdsoft.blp.gongyong.fanhui.FanHuiView;
import com.zdsoft.blp.gongyong.imageFrame.IvFrameView;
import com.zdsoft.blp.gongyong.imageTrans.CircleImage;
import com.zdsoft.blp.gongyong.net.BaseActivity;

/**
 * Created by Administrator on 2016/9/1.
 */
public class XQLTActivity extends BaseActivity {
    private TextView title_time,title_name,shequluntan_title,shequluntan_content,
            shequluntan_zan,shequluntan_pinglun;
    private ImageView title_iv,luntan_zan,luntan_pinglun;
    private Intent intent;
    private FanHuiView fh;
    private IvFrameView iv;
    private LinearLayout ll_lianxirne;
    @Override
    protected void init() {
        setContentView(R.layout.linli_sheyuluntan_luntanxiangqing);
//        实例化控件
        title_time=find(R.id.title_time);
        title_name=find(R.id.title_name);
        title_iv=find(R.id.title_iv);
        luntan_pinglun=find(R.id.luntan_pinglun);
        luntan_zan=find(R.id.luntan_zan);
        ll_lianxirne=find(R.id.ll_lianxirne);
        ll_lianxirne.setVisibility(View.GONE);
        iv=find(R.id.iv);
        fh=find(R.id.fh);
        fh.getTv_title().setText("论坛详情");

        shequluntan_title=find(R.id.shequluntan_title);
        shequluntan_content=find(R.id.shequluntan_content);
        shequluntan_zan=find(R.id.shequluntan_zan);
        shequluntan_pinglun=find(R.id.shequluntan_pinglun);
//        给布局赋值
        intent=getIntent();
        title_name.setText(intent.getStringExtra("name"));
        title_time.setText(intent.getStringExtra("date1"));
        shequluntan_title.setText(intent.getStringExtra("title"));
        shequluntan_content.setText(Html.fromHtml(intent.getStringExtra("content")));
        shequluntan_zan.setText(intent.getStringExtra("zan"));
        shequluntan_pinglun.setText(intent.getStringExtra("pinglun"));
        String image=intent.getStringExtra("image");
        if (!"".equals(image)){
            iv.show(new String[]{image});
        }
        String touxiang=intent.getStringExtra("touxiang");
        if (!"".equals(touxiang)){
            Picasso.with(this).load(touxiang).transform(new CircleImage()).into(title_iv);
        }
        luntan_pinglun.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent=new Intent(XQLTActivity.this,LLHFActivity.class);
                intent.putExtra("id","1");
                startActivity(intent);
            }
        });
    }
}
